package work20241207_chap8.c;

/**
 * @author zdl
 * @date 2024/12/7
 */
interface IA{
    void ma();
}
interface IB extends IA{
    void mb();
}
interface IC{
    void mc();
}
interface ID extends IB, IC{
    void md();
}
 class ClassE implements ID{
     @Override
     public void ma() {
         System.out.println("ma()");
     }

     @Override
     public void mb() {
         System.out.println("mb()");
     }

     @Override
     public void mc() {
         System.out.println("mc()");
     }

     @Override
     public void md() {
         System.out.println("md()");
     }
 }
public class TestClassE{
    public static void main(String[] args) {
        IC ic = new ClassE();
        System.out.println(ic instanceof IA); //true
        System.out.println(ic instanceof IB);//true
        System.out.println(ic instanceof IC);//true
        System.out.println(ic instanceof ID);//true
        System.out.println(ic instanceof ClassE);//true
        ID id = (ID) ic;
        id.ma();
        id.mb();
        id.mc();
        id.md();
    }
}
